package com.bokesoft.project.yigoext;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;

import org.yaml.snakeyaml.Yaml;

import com.bokesoft.yigo2.distro.yigosupport.ec.extension.base.IStaticMethodByArgsExtServiceWrapper;

public class SystemInfoService implements IStaticMethodByArgsExtServiceWrapper {
    
    public static String getSysInfo() {
        Map<String, String> env = new TreeMap<String, String>(System.getenv());
        Map<Object, Object> props = new TreeMap<Object, Object>(System.getProperties());

        Map<String, Object> result = new LinkedHashMap<String, Object>();
        result.put("properties", props);
        result.put("environment", env);

        Yaml y = new Yaml();
        return y.dumpAsMap(result);
    }

}